cc.Class({
    extends: cc.Component,

    properties: {
        normalActiveTrue: [cc.Node],
        disabledActiveFlase: [cc.Node]
    },
    editor: {
        menu: 'ExtendUI/ClickChangeToActive',
    },

    // use this for initialization
    onLoad: function () {
        this.node.on('click', this._onClick, this);
        this.node.on('click_cancel', this._onClickCancel, this);
    },

    _onClick: function() {
        // 转变为不可点击状态
        this.normalActiveTrue.forEach((v) => {
            v.active = false;
        });
        this.disabledActiveFlase.forEach((v) => {
            v.active = true;
        });
    },

    _onClickCancel: function() {
        // 转变为可点击状态
        this.normalActiveTrue.forEach((v) => {
            v.active = true;
        });
        this.disabledActiveFlase.forEach((v) => {
            v.active = false;
        });
    }
});